.class public Lcom/waiqin365/h5/io/WqDownloadLength;
.super Lorg/apache/cordova/CordovaPlugin;


# instance fields
.field private a:Lorg/apache/cordova/WqCordovaActivity;


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Lorg/apache/cordova/CordovaPlugin;-><init>()V

    return-void
.end method


# virtual methods
.method public execute(Ljava/lang/String;Lorg/apache/cordova/CordovaArgs;Lorg/apache/cordova/CallbackContext;)Z
    .locals 6

    const v5, 0x7f080615

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/waiqin365/h5/io/WqDownloadLength;->cordova:Lorg/apache/cordova/CordovaInterface;

    invoke-interface {v0}, Lorg/apache/cordova/CordovaInterface;->getActivity()Landroid/app/Activity;

    move-result-object v0

    check-cast v0, Lorg/apache/cordova/WqCordovaActivity;

    iput-object v0, p0, Lcom/waiqin365/h5/io/WqDownloadLength;->a:Lorg/apache/cordova/WqCordovaActivity;

    if-eqz p2, :cond_0

    invoke-virtual {p2, v1}, Lorg/apache/cordova/CordovaArgs;->isNull(I)Z

    move-result v0

    if-nez v0, :cond_0

    invoke-virtual {p2, v1}, Lorg/apache/cordova/CordovaArgs;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_2

    :try_start_0
    new-instance v2, Lorg/json/JSONObject;

    invoke-direct {v2, v0}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    const-string/jumbo v0, "fileName"

    invoke-virtual {v2, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iget-object v0, p0, Lcom/waiqin365/h5/io/WqDownloadLength;->a:Lorg/apache/cordova/WqCordovaActivity;

    iget-object v0, v0, Lorg/apache/cordova/WqCordovaActivity;->downLoadMap:Ljava/util/HashMap;

    invoke-virtual {v0, v2}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/waiqin365/h5/io/WqDownloadLength;->a:Lorg/apache/cordova/WqCordovaActivity;

    iget-object v0, v0, Lorg/apache/cordova/WqCordovaActivity;->downLoadMap:Ljava/util/HashMap;

    invoke-virtual {v0, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Integer;

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    :goto_0
    new-instance v3, Lorg/json/JSONObject;

    invoke-direct {v3}, Lorg/json/JSONObject;-><init>()V

    const-string/jumbo v4, "data"

    invoke-virtual {v3, v4, v0}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v0

    const-string/jumbo v3, "fileName"

    invoke-virtual {v0, v3, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v0

    invoke-virtual {p3, v0}, Lorg/apache/cordova/CallbackContext;->success(Lorg/json/JSONObject;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_1
    return v1

    :cond_0
    iget-object v0, p0, Lcom/waiqin365/h5/io/WqDownloadLength;->a:Lorg/apache/cordova/WqCordovaActivity;

    iget-object v2, p0, Lcom/waiqin365/h5/io/WqDownloadLength;->a:Lorg/apache/cordova/WqCordovaActivity;

    invoke-virtual {v2, v5}, Lorg/apache/cordova/WqCordovaActivity;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-static {v0, v2}, Lcom/waiqin365/lightapp/view/dk;->a(Landroid/content/Context;Ljava/lang/CharSequence;)V

    goto :goto_1

    :cond_1
    move v0, v1

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    iget-object v0, p0, Lcom/waiqin365/h5/io/WqDownloadLength;->a:Lorg/apache/cordova/WqCordovaActivity;

    iget-object v2, p0, Lcom/waiqin365/h5/io/WqDownloadLength;->a:Lorg/apache/cordova/WqCordovaActivity;

    invoke-virtual {v2, v5}, Lorg/apache/cordova/WqCordovaActivity;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-static {v0, v2}, Lcom/waiqin365/lightapp/view/dk;->a(Landroid/content/Context;Ljava/lang/CharSequence;)V

    goto :goto_1

    :cond_2
    iget-object v0, p0, Lcom/waiqin365/h5/io/WqDownloadLength;->a:Lorg/apache/cordova/WqCordovaActivity;

    iget-object v2, p0, Lcom/waiqin365/h5/io/WqDownloadLength;->a:Lorg/apache/cordova/WqCordovaActivity;

    invoke-virtual {v2, v5}, Lorg/apache/cordova/WqCordovaActivity;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-static {v0, v2}, Lcom/waiqin365/lightapp/view/dk;->a(Landroid/content/Context;Ljava/lang/CharSequence;)V

    goto :goto_1
.end method
